{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 3b. Calculate fO2 from melt ST for analyses from a csv file using default options\n", "\n", "This time, instead of creating a dataframe in a cell for the analysis, we'll read it in from a spreadsheet. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Python set-up\n", "You need to install VolFe once on your machine, if you haven't yet. Then we need to import a few Python packages (including VolFe)" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "# Install VolFe on your machine. Don't remove the # from this line!\n", "# pip install VolFe # Remove the first # in this line if you have not installed VolFe on your machine before.\n", "\n", "# import python packages\n", "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "import VolFe as vf" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Import data\n", "\n", "We'll use the examples_marianas_wT csv in files and use all the default options again and we'll do the calculation at Pvsat (i.e., we don't know the pressure). \n", "\n", "The data in this file are from Brounce et al. (2014) and Kelley & Cottrell (2012)." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "# Read csv to define melt composition\n", "my_analyses = pd.read_csv(\"../files/example_marianas_wT.csv\") " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Run the calculation\n", "\n", "### Calculate only for the first row\n", "\n", "There are a few analyses in the csv. First, we will tell the function to stop after the first analysis by saying last_row=1:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | sample | \n", "T ('C) | \n", "H2OT-eq_wtpc | \n", "CO2T-eq_ppmw | \n", "ST_ppmw | \n", "X_ppmw | \n", "P (bar) sulf | \n", "S2- SCSS | \n", "sulfide saturated? | \n", "DFMQ-sulfide | \n", "... | \n", "KHOSg opt | \n", "KOSg opt | \n", "KOSg2 opt | \n", "KCOg opt | \n", "KCOHg opt | \n", "KOCSg opt | \n", "KCOs opt | \n", "carbonylsulfide opt | \n", "density opt | \n", "Date | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "TN273-01D-01-01 | \n", "1200 | \n", "1.88 | \n", "13 | \n", "362.83 | \n", "0 | \n", "\n", " | 422.089182 | \n", "no | \n", "\n", " | ... | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "ONeill22 | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "Moussallam19 | \n", "Holloway92 | \n", "COS | \n", "DensityX | \n", "2024-07-13 18:12:06.185911 | \n", "
1 rows × 67 columns
\n", "